home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 86
/
(Vol 86) My Disc.iso
/
Games
/
habilidade_1209.swf
/
scripts
/
DefineSprite_547
/
frame_1
/
DoAction.as
Wrap
Text File
|
2009-04-22
|
2KB
|
96 lines
function loadData(arg)
{
resetField();
var _loc1_ = new LoadVars();
var _loc2_ = new LoadVars();
_loc2_.onLoad = function(s)
{
if(s)
{
if(Number(this.rsCnt == 0))
{
msg_mc.msg_txt.text = "???? ????.";
msg_mc._visible = true;
}
else
{
rankingData = this;
setData();
}
}
else
{
msg_mc.msg_txt.text = "?? ??? ????.";
msg_mc._visible = true;
}
};
if(arg == "today")
{
menu_mc.prevFrame();
}
else
{
menu_mc.nextFrame();
}
msg_mc.msg_txt.text = "??? ??...";
msg_mc._visible = true;
_loc1_.game_id = game_id;
_loc1_.loadType = arg;
_loc1_.sendAndLoad(baseURL + sScript1,_loc2_,"post");
}
function sendData()
{
var _loc1_ = new LoadVars();
var _loc2_ = new LoadVars();
_loc2_.onLoad = function(s)
{
if(s)
{
loadData("today");
}
};
msg_mc.msg_txt.text = "??? ??...";
msg_mc._visible = true;
_loc1_.game_id = game_id;
_loc1_.score = score;
_loc1_.sendAndLoad(baseURL + sScript2,_loc2_,"post");
}
function resetField()
{
var _loc2_ = this;
myRank.text = "";
myScore.text = "";
var _loc1_ = 0;
while(_loc1_ < 10)
{
_loc2_["user_id" + _loc1_].text = "";
_loc2_["score" + _loc1_].text = "";
_loc2_["date" + _loc1_].text = "";
_loc1_ = _loc1_ + 1;
}
}
function setData()
{
var _loc2_ = this;
msg_mc.msg_txt.text = "";
msg_mc._visible = false;
myRank.text = rankingData.myrank;
myScore.text = rankingData.myscore;
var _loc1_ = 0;
while(_loc1_ < 10)
{
_loc2_["user_id" + _loc1_].text = rankingData["id" + _loc1_];
_loc2_["score" + _loc1_].text = rankingData["score" + _loc1_];
_loc2_["date" + _loc1_].text = rankingData["date" + _loc1_];
_loc1_ = _loc1_ + 1;
}
}
stop();
var baseURL = _parent.baseURL;
var sScript1 = _parent.sScript1;
var sScript2 = _parent.sScript2;
var game_id = _parent.game_id;
var isLogin = Number(_parent.isLogin);
var score = _parent.score;
var rankingData = new Object();